package appapi.service.impl;

import appapi.Request.ApiReq.EquipApiReq;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import appapi.dao.TowerWorkDataMapper;
import appapi.entity.Zhongjiao.TowerWorkDataEntity;
import appapi.service.TowerWorkDataService;

import java.util.List;

/**
 * @version: java version 1.8
 * @Author: Ygp Work
 * @description:
 * @date: 2023-08-09 16:36
 */

@Service
public class TowerWorkDataServiceImpl implements TowerWorkDataService{

    @Resource
    private TowerWorkDataMapper towerWorkDataMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return towerWorkDataMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(TowerWorkDataEntity record) {
        return towerWorkDataMapper.insert(record);
    }

    @Override
    public int insertSelective(TowerWorkDataEntity record) {
        return towerWorkDataMapper.insertSelective(record);
    }

    @Override
    public TowerWorkDataEntity selectByPrimaryKey(Integer id) {
        return towerWorkDataMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(TowerWorkDataEntity record) {
        return towerWorkDataMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(TowerWorkDataEntity record) {
        return towerWorkDataMapper.updateByPrimaryKey(record);
    }

     @Override
     public PageInfo<TowerWorkDataEntity> selectPage(EquipApiReq req) {
         PageHelper.startPage(req.getCurrentPage(), req.getPageSize());
         List<TowerWorkDataEntity> list = towerWorkDataMapper.selectAll(req);
         return new PageInfo<>(list,req.getPageSize());
     }


 }
